package com.cy.pj.eiems.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cy.pj.eiems.entity.SysQuestion;
import com.cy.pj.eiems.service.SysQuestionService;
import com.cy.pj.eiems.vo.JsonResult;



//@Controller
@Controller



@RequestMapping("/question/")

public class SysQuestionController {
	@Autowired
	private SysQuestionService sysQeustionService;
	
	
	@RequestMapping("doDeleteObject")
	@ResponseBody
	public JsonResult doDeleteObject(Integer id) {
		sysQeustionService.deleteObject(id);
		return new JsonResult("删除成功!");
	}

	//------------呈现所有试卷上的信息
	@GetMapping("doFindObjects2")
	@ResponseBody
	public JsonResult doFindObjects2() { 
		return new JsonResult(
				sysQeustionService.findObjects2());
	}
	
	
	
	@GetMapping("doFindObjects")
	@ResponseBody
	public JsonResult doFindObjects() { 
		return new JsonResult(
				sysQeustionService.findObjects());
	}
	//ztree
	
	@RequestMapping("doFindZtreeExamTypeNodes")
	@ResponseBody
	public JsonResult doFindZtreeExamTypeNodes() {
		return new JsonResult(
				sysQeustionService.findZtreeExamTypeNodes());
	}
	
	
	
	
	//----------------------------
	@RequestMapping("doSaveObject")
	@ResponseBody
	public JsonResult doSaveObject(SysQuestion entity){
		sysQeustionService.saveObject(entity);
		return new JsonResult("保存成功");
	}
	
	@RequestMapping("doUpdateObject")
	@ResponseBody
	public JsonResult doUpdateObject(SysQuestion entity) {
		sysQeustionService.updateObject(entity);
		return new JsonResult("更新成功!");
	}
}
